const KEY = 'hkzf_token'

// 保存token
const setToken = token => {
  localStorage.setItem(KEY, token)
}

// 获取token
const getToken = () => {
  return localStorage.getItem(KEY)
}

// 移除token
const removeToken = () => {
  localStorage.removeItem(KEY)
}

// 判断是否登录了
const isAuth = () => {
  return getToken() != null ? true : false
}

export { setToken, getToken, removeToken, isAuth }
